#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>

size_t my_strlen (char *s)
{
	int 		i=0;
	for (; s[i]; i++);
	return i;
}

char *my_strchr (char *s, char c)
{
	for (; *s && *s!=c; s++);
	return (*s==c?s:NULL);
}

int my_strcmp (char *s1, char *s2, size_t len)
{
	size_t		i=0;
	for (;s1[i]==s2[i] && i<len ;i++);
	return s1[i] - s2[i];
}

char *my_strcpy (char *dst, char *src, size_t len)
{
	size_t 		i=0;
	for (; src[i] && i<len; i++)
	{
		dst[i] = src[i];
	}
	for (; i<len; i++)
		dst[i] = '\0';
	return dst;
}

size_t str_downcase (char *chaine)
{
	size_t		len=0, ret=0, i;
	len = my_strlen(chaine);
	for (i=0 ; i<len; i++)
		if (chaine[i] + 32 < 123 && chaine[i] > 64)
		{
			chaine[i] = chaine[i] + 32;
			ret++;
		}
	return ret;			
}

size_t str_upcase (char *chaine)
{
	size_t		len=0, ret=0, i;
	len = my_strlen(chaine);
	for (i=0 ; i<len; i++)
		if (chaine[i] - 32 > 64 && chaine[i] < 123)
		{
			chaine[i] = chaine[i] - 32;
			ret++;
		}
	return ret;			
}


int main (int argc, char **argv)
{
        char 		*chaine=NULL;
	if (argc < 2)
		return -1;
	chaine = argv[1];
	printf ("%d - %s\n", str_upcase(chaine), chaine );
	return 0;
}

